package com.wcy.feign.user;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wcy.entity.UserCollection;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDateTime;
import java.util.List;

@FeignClient(name = "cloud-provider-user", contextId = "FeignUserCollection")
public interface FeignUserCollectionService {
    @GetMapping("userCollection/page")
    public ResponseEntity<Page<UserCollection>> getPage(@RequestParam(name = "pageNum",defaultValue = "1") int pageNum,
                                                        @RequestParam(name = "pageSize",defaultValue = "10") int pageSize);
    @GetMapping("userCollection/list")
    public ResponseEntity<List<UserCollection>> getList();
    @PostMapping("userCollection/add")
    public ResponseEntity<Void> add(@RequestBody UserCollection userCollection);
    @PutMapping("userCollection/update")
    public ResponseEntity<Void> update(@RequestBody UserCollection userCollection);
    @DeleteMapping("userCollection/delete/{id}")
    public ResponseEntity<Void> delete(@PathVariable("id") Integer id);

    @GetMapping("userCollection/user/page")
    public ResponseEntity<Page<UserCollection>> getUserCollectionPage(@RequestParam(name = "pageNum",defaultValue = "1") int pageNum,
                                                        @RequestParam(name = "pageSize",defaultValue = "10") int pageSize);

    @GetMapping("userCollection/user/{id}")
    public ResponseEntity<Boolean> hasCollection(@PathVariable("id") Integer id);
    @DeleteMapping("userCollection/user/delete/{id}")
    public ResponseEntity<Boolean> deleteCollection(@PathVariable("id") Integer id);

    @PostMapping("userCollection/user/add/{id}")
    public ResponseEntity<Boolean> addCollection(@PathVariable("id") Integer id);
}
